// 	Name: 02.c
//	Description: Chapter 5 project 2
//	Author: StableGenius
//	Date: 2020-05-07
//	Email: feng@dongfa.pro

#include <stdio.h>

int main(void)
{
	int hour, minutes;
	
	printf("Enter a 24-hour time: ");
	scanf("%d : %d", &hour, &minutes);
	
	if (hour < 12){
		printf("Equivalent 12-hour time: %d:%.2d AM\n", 
			hour == 0 ? 12 : hour, minutes);
	} else {
		printf("Equivalent 12-hour time: %d:%.2d PM\n", 
			hour == 12 ? 12 : hour - 12, minutes);
	}

	return 0;
}
